a1006ede2c08cb6041e980bf0019fd587d545061
[motion-next.git] /
1 <md-dialog class="action-dialog" aria-label="New Action">
2   <form name="actionForm" class="md-inline-form" novalidate>
3     <md-toolbar class="md-accent md-hue-2">
4       <div
5         class="md-toolbar-tools"
6         layout="row"
7         layout-align="space-between center"
8       >
9         <span class="title"
10           >{{ vm.newAction ? 'TOOLS.NEW_ACTION' : 'TOOLS.EDIT_ACTION' |
11           translate }}</span
12         >
13         <md-button class="md-icon-button" ng-click="vm.closeDialog()">
14           <md-icon
15             md-font-icon="icon-close"
16             aria-label="Close dialog"
17           ></md-icon>
18         </md-button>
19       </div>
20     </md-toolbar>
21     <md-dialog-content ms-scroll>
22       <md-input-container class="md-block">
23         <label translate="TOOLS.ACTION">Action</label>
24         <md-select
25           name="action"
26           ng-model="vm.action.action"
27           ng-init="vm.onActionInit()"
28           ng-change="vm.onActionSelection()"
29           md-autofocus
30           required
31           ng-disabled="!vm.newAction"
32         >
33           <md-option
34             ng-value="'contactManager'"
35             ng-if="vm.trigger.channel == 'voice'"
36           >
37             {{ 'TOOLS.CONTACT_MANAGER' | translate }}
38           </md-option>
39           <md-option
40             ng-value="'integration'"
41             ng-if="vm.trigger.channel == 'voice' && ((vm.newAction && vm.hasIntegrationsPermissions) || !vm.newAction)"
42           >
43             {{ 'TOOLS.INTEGRATIONS' | translate }}
44           </md-option>
45           <md-option ng-value="'motionbar'">
46             {{ 'TOOLS.MOTIONBAR' | translate }}
47           </md-option>
48           <md-option ng-value="'jscripty'">
49             {{ 'TOOLS.JSCRIPTY' | translate }}
50           </md-option>
51           <md-option ng-value="'urlForward'">
52             {{ 'TOOLS.URL_FORWARD' | translate }}
53           </md-option>
54           <md-option ng-value="'browser'">
55             {{ 'TOOLS.BROWSER' | translate }}
56           </md-option>
57           <md-option ng-value="'bot'" ng-if="vm.trigger.channel == 'voice'">
58             {{ 'TOOLS.BOT' | translate }}
59           </md-option>
60           <md-option ng-value="'script'">
61             {{ 'TOOLS.SCRIPT' | translate }}
62           </md-option>
63         </md-select>
64         <div
65           ng-messages="actionForm['action'].$error"
66           ng-show="actionForm['action'].$touched"
67           role="alert"
68         >
69           <div ng-message="required">
70             <span translate="TOOLS.ERRORS.ACTION_REQUIRED"
71               >Action field is required</span
72             >
73           </div>
74         </div>
75       </md-input-container>
76       <md-input-container
77         ng-if="vm.action.action == 'jscripty'"
78         class="md-block"
79       >
80         <label translate="TOOLS.PROJECT">Project</label>
81         <md-select name="data1" ng-model="vm.action.data1" required>
82           <md-option
83             ng-value="''+data1.id"
84             ng-repeat="data1 in vm.projects"
85             ng-disabled="data1.canSelect === false"
86           >
87             {{ data1.name }}</md-option
88           >
89         </md-select>
90         <div
91           ng-messages="actionForm['data1'].$error"
92           ng-show="actionForm['data1'].$touched"
93           role="alert"
94         >
95           <div ng-message="required">
96             <span translate="TOOLS.ERRORS.PROJECT_REQUIRED"
97               >Project field is required</span
98             >
99           </div>
100         </div>
101       </md-input-container>
102       <md-input-container
103         ng-if="vm.action.action == 'browser'"
104         class="md-block"
105       >
106         <label translate="TOOLS.TYPE">Type</label>
107         <md-select
108           name="data1"
109           ng-model="vm.action.data1"
110           ng-change="vm.onTypeSelection()"
111           required
112         >
113           <md-option ng-value="'0'">Popup</md-option>
114           <md-option ng-value="'1'">CTI URL</md-option>
115         </md-select>
116         <div
117           ng-messages="actionForm['data1'].$error"
118           ng-show="actionForm['data1'].$touched"
119           role="alert"
120         >
121           <div ng-message="required">
122             <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
123               >Type field is required</span
124             >
125           </div>
126         </div>
127       </md-input-container>
128       <md-input-container
129         ng-if="vm.action.action == 'contactManager'"
130         class="md-block"
131       >
132         <label translate="TOOLS.LIST">List</label>
133         <md-select
134           name="data1"
135           ng-model="vm.action.data1"
136           ng-change="vm.onListSelection()"
137           required
138         >
139           <md-option
140             ng-value="''+data1.id"
141             ng-repeat="data1 in vm.lists"
142             ng-disabled="data1.canSelect === false"
143           >
144             {{ data1.name }}</md-option
145           >
146         </md-select>
147         <div
148           ng-messages="actionForm['data1'].$error"
149           ng-show="actionForm['data1'].$touched"
150           role="alert"
151         >
152           <div ng-message="required">
153             <span translate="TOOLS.ERRORS.LIST_REQUIRED"
154               >List field is required</span
155             >
156           </div>
157         </div>
158       </md-input-container>
159       <md-input-container
160         ng-if="vm.action.action == 'contactManager'"
161         class="md-block"
162       >
163         <label translate="TOOLS.SEARCH_FIELDS">Search fields</label>
164         <md-select
165           name="fields"
166           ng-model="vm.action.data3"
167           ng-init="vm.onSearchFieldsInit()"
168           multiple
169           required
170         >
171           <md-optgroup label="{{ 'TOOLS.STANDARD' | translate }}">
172             <md-option
173               ng-value="field.columnName"
174               ng-repeat="field in vm.contactFields"
175             >
176               {{ field.displayName }}</md-option
177             >
178           </md-optgroup>
179           <md-optgroup
180             label="{{ 'TOOLS.LIST' | translate }}"
181             ng-if="vm.listFields.length > 0"
182           >
183             <md-option
184               ng-value="field.columnName"
185               ng-repeat="field in vm.listFields"
186             >
187               {{ field.name }}</md-option
188             >
189           </md-optgroup>
190           <md-optgroup
191             label="{{ 'TOOLS.GLOBALS' | translate }}"
192             ng-if="vm.customFields.length > 0"
193           >
194             <md-option
195               ng-value="field.columnName"
196               ng-repeat="field in vm.customFields"
197             >
198               {{ field.displayName }}</md-option
199             >
200           </md-optgroup>
201         </md-select>
202         <div
203           ng-messages="actionForm['data3'].$error"
204           ng-show="actionForm['data3'].$touched"
205           role="alert"
206         >
207           <div ng-message="required">
208             <span translate="TOOLS.ERRORS.SEARCH_FIELDS_REQUIRED"
209               >Search fields field is required</span
210             >
211           </div>
212         </div>
213       </md-input-container>
214       <md-input-container
215         ng-if="vm.action.action == 'contactManager'"
216         class="md-block"
217       >
218         <label translate="TOOLS.AUTOCREATECONTACT"
219           >Create contact automatically</label
220         >
221         <md-select
222           name="data2"
223           ng-model="vm.action.data2"
224           ng-change="vm.onAutocreateSelection()"
225           required
226         >
227           <md-option ng-value="'1'"> {{ 'TOOLS.YES' | translate }} </md-option>
228           <md-option ng-value="'0'"> {{ 'TOOLS.NO' | translate }} </md-option>
229         </md-select>
230         <div
231           ng-messages="actionForm['data2'].$error"
232           ng-show="actionForm['data2'].$touched"
233           role="alert"
234         >
235           <div ng-message="required">
236             <span translate="TOOLS.ERRORS.AUTOCREATECONTACT_REQUIRED"
237               >AutoCreateContact field is required</span
238             >
239           </div>
240         </div>
241       </md-input-container>
242       <md-input-container
243         ng-if="vm.action.action == 'contactManager' && vm.action.data2 === '1'"
244         class="md-block"
245       >
246         <label translate="TOOLS.AUTOCREATE_FIELD">Autocreate field</label>
247         <md-select
248           name="autocreateField"
249           ng-model="vm.action.data4"
250           ng-required="vm.action.data2 === '1'"
251         >
252           <md-optgroup label="{{ 'TOOLS.STANDARD' | translate }}">
253             <md-option
254               ng-value="field.columnName"
255               ng-repeat="field in vm.contactFields"
256             >
257               {{ field.displayName }}</md-option
258             >
259           </md-optgroup>
260           <md-optgroup
261             label="{{ 'TOOLS.LIST' | translate }}"
262             ng-if="vm.listFields.length > 0"
263           >
264             <md-option
265               ng-value="field.columnName"
266               ng-repeat="field in vm.listFields"
267             >
268               {{ field.name }}</md-option
269             >
270           </md-optgroup>
271           <md-optgroup
272             label="{{ 'TOOLS.GLOBALS' | translate }}"
273             ng-if="vm.customFields.length > 0"
274           >
275             <md-option
276               ng-value="field.columnName"
277               ng-repeat="field in vm.customFields"
278             >
279               {{ field.displayName }}</md-option
280             >
281           </md-optgroup>
282         </md-select>
283         <div
284           ng-messages="actionForm['data4'].$error"
285           ng-show="actionForm['data4'].$touched"
286           role="alert"
287         >
288           <div ng-message="required">
289             <span translate="TOOLS.ERRORS.AUTOCREATE_FIELD_REQUIRED"
290               >Autocreate field is required</span
291             >
292           </div>
293         </div>
294       </md-input-container>
295       <md-input-container
296         ng-if="vm.action.action == 'urlForward'"
297         class="md-block"
298       >
299         <label translate="TOOLS.TYPE">Type</label>
300         <md-select name="data1" ng-model="vm.action.data1" required>
301           <md-option ng-value="'GET'">GET</md-option>
302           <md-option ng-value="'POST'">POST</md-option>
303           <md-option ng-value="'PUT'">PUT</md-option>
304           <md-option ng-value="'DELETE'">DELETE</md-option>
305         </md-select>
306         <div
307           ng-messages="actionForm['data1'].$error"
308           ng-show="actionForm['data1'].$touched"
309           role="alert"
310         >
311           <div ng-message="required">
312             <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
313               >Type field is required</span
314             >
315           </div>
316         </div>
317       </md-input-container>
318       <md-input-container
319         ng-if="vm.action.action == 'urlForward'"
320         class="md-block"
321       >
322         <label translate="TOOLS.URL">Url</label>
323         <input
324           type="url"
325           name="data2"
326           ng-model="vm.action.data2"
327           ng-required="true"
328         />
329         <div
330           ng-messages="actionForm['data2'].$error"
331           ng-show="actionForm['data2'].$touched"
332           role="alert"
333         >
334           <div ng-message="required">
335             <span translate="TOOLS.ERRORS.URL_REQUIRED"
336               >Url field is required</span
337             >
338           </div>
339           <div ng-message="url">
340             <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
341               >Url must be a valid url http://www.xcally.com</span
342             >
343           </div>
344         </div>
345       </md-input-container>
346       <md-input-container
347         ng-if="vm.action.action == 'urlForward'"
348         class="md-block"
349       >
350         <label translate="TOOLS.TIMEOUT">Timeout</label>
351         <input
352           type="number"
353           name="data5"
354           ng-model="vm.action.data5"
355           min="1"
356           max="10"
357           ng-required="true"
358         />
359         <div class="hint"><span translate="TOOLS.HELP.TIMEOUT"></span></div>
360         <div
361           ng-messages="actionForm['data5'].$error"
362           ng-show="actionForm['data5'].$touched"
363           role="alert"
364         >
365           <div ng-message="required">
366             <span translate="TOOLS.ERRORS.TIMEOUT_REQUIRED"
367               >Timeout field is required</span
368             >
369           </div>
370           <div ng-message="min">
371             <span
372               translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO"
373               >Timeout must be a valid greater or equal than</span
374             >
375             <span>1</span>
376           </div>
377           <div ng-message="max">
378             <span translate="TOOLS.ERRORS.TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO"
379               >Timeout must be a valid greater or equal than</span
380             >
381             <span>10</span>
382           </div>
383         </div>
384       </md-input-container>
385       <md-input-container
386         ng-if="vm.action.action == 'urlForward'"
387         class="md-block"
388       >
389         <label translate="TOOLS.HEADERS">Headers</label>
390         <textarea name="data6" ng-model="vm.action.data6"></textarea>
391         <div class="hint"><span translate="TOOLS.HELP.HEADERS"></span></div>
392       </md-input-container>
393       <md-input-container
394         ng-if="vm.action.action == 'urlForward' && (vm.action.data1 == 'POST' || vm.action.data1 == 'PUT')"
395         class="md-block"
396       >
397         <label translate="TOOLS.BODY">Body</label>
398         <textarea name="data7" ng-model="vm.action.data7"></textarea>
399         <div class="hint"><span translate="TOOLS.HELP.BODY"></span></div>
400       </md-input-container>
401       <md-input-container ng-if="vm.action.action == 'script'" class="md-block">
402         <label translate="TOOLS.SCRIPT_TYPE">Script_Type</label>
403         <input type="input" name="data2" ng-model="vm.action.data2" />
404         <div class="hint"><span translate="TOOLS.HELP.SCRIPT_TYPE"></span></div>
405         <div
406           ng-messages="actionForm['data2'].$error"
407           ng-show="actionForm['data2'].$touched"
408           role="alert"
409         >
410           <div ng-message="required">
411             <span translate="TOOLS.ERRORS.SCRIPT_TYPE_REQUIRED"
412               >Script_Type field is required</span
413             >
414           </div>
415         </div>
416       </md-input-container>
417       <md-input-container ng-if="vm.action.action == 'script'" class="md-block">
418         <label translate="TOOLS.SCRIPT_INFO">Script_Info</label>
419         <input type="input" name="data1" ng-model="vm.action.data1" />
420         <div class="hint"><span translate="TOOLS.HELP.SCRIPT_INFO"></span></div>
421         <div
422           ng-messages="actionForm['data1'].$error"
423           ng-show="actionForm['data1'].$touched"
424           role="alert"
425         >
426           <div ng-message="required">
427             <span translate="TOOLS.ERRORS.SCRIPT_INFO_REQUIRED"
428               >Script_Info field is required</span
429             >
430           </div>
431         </div>
432       </md-input-container>
433       <md-input-container ng-if="vm.action.action == 'script'" class="md-block">
434         <label translate="TOOLS.SCRIPT">Script</label>
435         <textarea name="data3" ng-model="vm.action.data3" required></textarea>
436         <div class="hint"><span translate="TOOLS.HELP.SCRIPT"></span></div>
437         <div
438           ng-messages="actionForm['data3'].$error"
439           ng-show="actionForm['data3'].$touched"
440           role="alert"
441         >
442           <div ng-message="required">
443             <span translate="TOOLS.ERRORS.SCRIPT_REQUIRED"
444               >Script field is required</span
445             >
446           </div>
447         </div>
448       </md-input-container>
449       <md-input-container
450         ng-if="vm.action.action == 'integration'"
451         class="md-block"
452       >
453         <label translate="TOOLS.INTEGRATION">Integration</label>
454         <md-select
455           name="data1"
456           ng-model="vm.action.data1"
457           ng-init="vm.onIntegrationInit()"
458           ng-change="vm.onIntegrationSelection()"
459           required
460         >
461           <md-option
462             ng-value="'zendesk'"
463             ng-if="(vm.newAction && vm.hasSectionPermissions[1301]) || !vm.newAction"
464             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1301])"
465             >Zendesk</md-option
466           >
467           <md-option
468             ng-value="'salesforce'"
469             ng-if="(vm.newAction && vm.hasSectionPermissions[1302]) || !vm.newAction"
470             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1302])"
471             >Salesforce</md-option
472           >
473           <md-option
474             ng-value="'sugarcrm'"
475             ng-if="(vm.newAction && vm.hasSectionPermissions[1305]) || !vm.newAction"
476             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1305])"
477             >SugarCRM</md-option
478           >
479           <md-option
480             ng-value="'freshdesk'"
481             ng-if="(vm.newAction && vm.hasSectionPermissions[1303]) || !vm.newAction"
482             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1303])"
483             >Freshdesk</md-option
484           >
485           <md-option
486             ng-value="'desk'"
487             ng-if="(vm.newAction && vm.hasSectionPermissions[1306]) || !vm.newAction"
488             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1306])"
489             >Desk</md-option
490           >
491           <md-option
492             ng-value="'zoho'"
493             ng-if="(vm.newAction && vm.hasSectionPermissions[1307]) || !vm.newAction"
494             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1307])"
495             >Zoho</md-option
496           >
497           <md-option
498             ng-value="'vtiger'"
499             ng-if="(vm.newAction && vm.hasSectionPermissions[1308]) || !vm.newAction"
500             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1308])"
501             >vTiger</md-option
502           >
503           <md-option
504             ng-value="'dynamics365'"
505             ng-if="(vm.newAction && vm.hasSectionPermissions[1309]) || !vm.newAction"
506             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1309])"
507             >Dynamics365</md-option
508           >
509           <md-option
510             ng-value="'servicenow'"
511             ng-if="(vm.newAction && vm.hasSectionPermissions[1310]) || !vm.newAction"
512             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1310])"
513             >ServiceNow</md-option
514           >
515           <md-option
516             ng-value="'freshsales'"
517             ng-if="(vm.newAction && vm.hasSectionPermissions[1311]) || !vm.newAction"
518             ng-disabled="(!vm.newAction && !vm.hasSectionPermissions[1311])"
519             >Freshsales</md-option
520           >
521         </md-select>
522         <div
523           ng-messages="actionForm['data1'].$error"
524           ng-show="actionForm['data1'].$touched"
525           role="alert"
526         >
527           <div ng-message="required">
528             <span translate="TOOLS.ERRORS.INTEGRATION_REQUIRED"
529               >Integration field is required</span
530             >
531           </div>
532         </div>
533       </md-input-container>
534       <md-input-container
535         ng-if="vm.action.action == 'integration' && vm.action.data1"
536         class="md-block"
537       >
538         <label translate="TOOLS.ACCOUNT">Account</label>
539         <md-select
540           name="data2"
541           ng-model="vm.action.data2"
542           ng-change="vm.onIntegrationAccountSelection()"
543           ng-disabled="vm.action.isIntegrationDisabled"
544           required
545         >
546           <md-option ng-value="''+data2.id" ng-repeat="data2 in vm.accounts"
547             >{{ data2.name }}</md-option
548           >
549         </md-select>
550         <div
551           ng-messages="actionForm['data2'].$error"
552           ng-show="actionForm['data2'].$touched"
553           role="alert"
554         >
555           <div ng-message="required">
556             <span translate="TOOLS.ERRORS.ACCOUNT_REQUIRED"
557               >Account field is required</span
558             >
559           </div>
560         </div>
561       </md-input-container>
562       <md-input-container
563         ng-if="vm.action.action == 'integration'  && vm.action.data1 && vm.action.data2"
564         class="md-block"
565       >
566         <label translate="TOOLS.CONFIGURATION">Configuration</label>
567         <md-select
568           name="data3"
569           ng-model="vm.action.data3"
570           required
571           ng-disabled="vm.action.isIntegrationDisabled"
572         >
573           <md-option
574             ng-value="''+data3.id"
575             ng-repeat="data3 in vm.configurations | filter:{ AccountId:vm.action.data2 }"
576             >{{ data3.name }}</md-option
577           >
578         </md-select>
579         <div
580           ng-messages="actionForm['data3'].$error"
581           ng-show="actionForm['data3'].$touched"
582           role="alert"
583         >
584           <div ng-message="required">
585             <span translate="TOOLS.ERRORS.CONFIGURATION_REQUIRED"
586               >Configuration field is required</span
587             >
588           </div>
589         </div>
590       </md-input-container>
591       <md-input-container
592         ng-if="vm.action.action == 'motionbar'"
593         class="md-block"
594       >
595         <label translate="TOOLS.TYPE">Type</label>
596         <md-select
597           name="data1"
598           ng-model="vm.action.data1"
599           ng-change="vm.onTypeSelection()"
600           required
601         >
602           <md-option ng-value="'0'">Popup</md-option>
603           <md-option ng-value="'1'">CTI URL</md-option>
604           <md-option ng-value="'2'">Windows App</md-option>
605         </md-select>
606         <div
607           ng-messages="actionForm['data1'].$error"
608           ng-show="actionForm['data1'].$touched"
609           role="alert"
610         >
611           <div ng-message="required">
612             <span translate="TOOLS.ERRORS.TYPE_REQUIRED"
613               >Type field is required</span
614             >
615           </div>
616         </div>
617       </md-input-container>
618       <md-input-container
619         ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '1'"
620         class="md-block"
621       >
622         <label translate="TOOLS.URL">Url</label>
623         <input
624           type="url"
625           name="data2"
626           ng-model="vm.action.data2"
627           ng-required="true"
628         />
629         <div
630           ng-messages="actionForm['data2'].$error"
631           ng-show="actionForm['data2'].$touched"
632           role="alert"
633         >
634           <div ng-message="required">
635             <span translate="TOOLS.ERRORS.URL_REQUIRED"
636               >Url field is required</span
637             >
638           </div>
639           <div ng-message="url">
640             <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
641               >Url must be a valid url http://www.xcally.com</span
642             >
643           </div>
644         </div>
645       </md-input-container>
646       <md-input-container
647         ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '2'"
648         class="md-block"
649       >
650         <label translate="TOOLS.APPLICATION">Application</label>
651         <input
652           type="text"
653           name="data2"
654           ng-model="vm.action.data2"
655           ng-required="true"
656         />
657         <div
658           ng-messages="actionForm['data2'].$error"
659           ng-show="actionForm['data2'].$touched"
660           role="alert"
661         >
662           <div ng-message="required">
663             <span translate="TOOLS.ERRORS.APPLICATION_REQUIRED"
664               >Application field is required</span
665             >
666           </div>
667         </div>
668       </md-input-container>
669       <md-input-container
670         ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '2'"
671         class="md-block"
672       >
673         <label translate="TOOLS.ARGUMENTS">Arguments</label>
674         <input type="text" name="data3" ng-model="vm.action.data3" />
675         <div
676           ng-messages="actionForm['data3'].$error"
677           ng-show="actionForm['data3'].$touched"
678           role="alert"
679         >
680           <div ng-message="required">
681             <span translate="TOOLS.ERRORS.ARGUMENTS_REQUIRED"
682               >Arguments field is required</span
683             >
684           </div>
685         </div>
686       </md-input-container>
687       <md-input-container
688         ng-if="vm.action.action == 'motionbar' && vm.action.data1 == '0'"
689         class="md-block"
690       >
691         <label translate="TOOLS.TEMPLATE">Template</label>
692         <md-select name="data2" ng-model="vm.action.data2" required>
693           <md-option
694             ng-value="''+data2.id"
695             ng-repeat="data2 in vm.templates"
696             ng-disabled="data2.canSelect === false"
697           >
698             {{ data2.name }}</md-option
699           >
700         </md-select>
701         <div
702           ng-messages="actionForm['data2'].$error"
703           ng-show="actionForm['data2'].$touched"
704           role="alert"
705         >
706           <div ng-message="required">
707             <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED"
708               >Template field is required</span
709             >
710           </div>
711         </div>
712       </md-input-container>
713       <md-input-container
714         ng-if="vm.action.action == 'browser' && vm.action.data1 == '0'"
715         class="md-block"
716       >
717         <label translate="TOOLS.TEMPLATE">Template</label>
718         <md-select name="data2" ng-model="vm.action.data2" required>
719           <md-option
720             ng-value="''+data2.id"
721             ng-repeat="data2 in vm.templates"
722             ng-disabled="data2.canSelect === false"
723           >
724             {{ data2.name }}</md-option
725           >
726         </md-select>
727         <div
728           ng-messages="actionForm['data2'].$error"
729           ng-show="actionForm['data2'].$touched"
730           role="alert"
731         >
732           <div ng-message="required">
733             <span translate="TOOLS.ERRORS.TEMPLATE_REQUIRED"
734               >Template field is required</span
735             >
736           </div>
737         </div>
738       </md-input-container>
739       <md-input-container
740         ng-if="vm.action.action == 'browser' && vm.action.data1 == '1'"
741         class="md-block"
742       >
743         <label translate="TOOLS.URL">Url</label>
744         <input
745           type="url"
746           name="data2"
747           ng-model="vm.action.data2"
748           ng-required="true"
749         />
750         <div
751           ng-messages="actionForm['data2'].$error"
752           ng-show="actionForm['data2'].$touched"
753           role="alert"
754         >
755           <div ng-message="required">
756             <span translate="TOOLS.ERRORS.URL_REQUIRED"
757               >Url field is required</span
758             >
759           </div>
760           <div ng-message="url">
761             <span translate="TOOLS.ERRORS.URL_MUST_VALID_URL"
762               >Url must be a valid url http://www.xcally.com</span
763             >
764           </div>
765         </div>
766       </md-input-container>
767       <md-input-container
768         ng-if="(vm.action.action == 'motionbar' || vm.action.action == 'browser') && vm.action.data1 == '1'"
769         class="md-block"
770       >
771         <label translate="TOOLS.EVENTVARIABLES">EventVariables</label>
772         <md-select name="data3" ng-model="vm.action.data3" required>
773           <md-option ng-value="'1'"> {{ 'TOOLS.YES' | translate }} </md-option>
774           <md-option ng-value="'0'"> {{ 'TOOLS.NO' | translate }} </md-option>
775         </md-select>
776         <div class="hint">
777           <span translate="TOOLS.HELP.EVENTVARIABLES"></span>
778         </div>
779         <div
780           ng-messages="actionForm['data3'].$error"
781           ng-show="actionForm['data3'].$touched"
782           role="alert"
783         >
784           <div ng-message="required">
785             <span translate="TOOLS.ERRORS.EVENTVARIABLES_REQUIRED"
786               >EventVariables field is required</span
787             >
788           </div>
789         </div>
790       </md-input-container>
791       <md-input-container
792         ng-if="vm.action.action == 'browser' && vm.action.data1 == '1'"
793         class="md-block"
794       >
795         <label translate="TOOLS.LOCATION">Location</label>
796         <md-select name="data4" ng-model="vm.action.data4" required>
797           <md-option ng-value="'0'" ng-selected="true">
798             {{ 'TOOLS.NEW_TAB' | translate }}
799           </md-option>
800           <md-option ng-value="'1'">
801             {{ 'TOOLS.NEW_WINDOW' | translate }}
802           </md-option>
803           <md-option ng-value="'2'">
804             {{ 'TOOLS.MOTION_TAB' | translate }}
805           </md-option>
806         </md-select>
807         <div
808           ng-messages="actionForm['data4'].$error"
809           ng-show="actionForm['data4'].$touched"
810           role="alert"
811         >
812           <div ng-message="required">
813             <span translate="TOOLS.ERRORS.LOCATION_REQUIRED"
814               >Location field is required</span
815             >
816           </div>
817         </div>
818       </md-input-container>
819       <md-input-container
820         ng-if="vm.action.action == 'browser' && vm.action.data4 == '1'"
821         class="md-block"
822       >
823         <label translate="TOOLS.WINDOWWIDTH">WindowWidth</label>
824         <input type="text" name="data5" ng-model="vm.action.data5" />
825         <div
826           ng-messages="actionForm['data5'].$error"
827           ng-show="actionForm['data5'].$touched"
828           role="alert"
829         >
830           <div ng-message="required">
831             <span translate="TOOLS.ERRORS.WINDOWWIDTH_REQUIRED"
832               >WindowWidth field is required</span
833             >
834           </div>
835         </div>
836       </md-input-container>
837       <md-input-container
838         ng-if="vm.action.action == 'browser' && vm.action.data4 == '1'"
839         class="md-block"
840       >
841         <label translate="TOOLS.WINDOWHEIGHT">WindowHeight</label>
842         <input type="text" name="data6" ng-model="vm.action.data6" />
843         <div
844           ng-messages="actionForm['data6'].$error"
845           ng-show="actionForm['data6'].$touched"
846           role="alert"
847         >
848           <div ng-message="required">
849             <span translate="TOOLS.ERRORS.WINDOWHEIGHT_REQUIRED"
850               >WindowHeight field is required</span
851             >
852           </div>
853         </div>
854       </md-input-container>
855       <div class="error-list">
856         <div
857           ng-repeat="error in vm.errors"
858           class="error"
859           layout="row"
860           layout-align="space-between center"
861         >
862           <div>
863             <span class="message">{{error.message}}</span>
864             <span class="type">({{error.type}})</span>
865           </div>
866           <md-button class="md-icon-button">
867             <md-icon
868               md-font-icon="icon-alert-box"
869               aria-label="alert error"
870               class="s16"
871             ></md-icon>
872           </md-button>
873         </div>
874       </div>
875     </md-dialog-content>
876     <md-dialog-actions
877       layout="row"
878       layout-align="space-between center"
879       ng-if="!vm.crudPermissions.readOnly"
880     >
881       <div layout="row" layout-align="start center">
882         <md-button
883           type="submit"
884           ng-if="vm.crudPermissions.canEdit && !vm.newAction"
885           ng-click="vm.saveAction()"
886           class="send-button md-accent md-raised"
887           ng-disabled="actionForm.$invalid || actionForm.$pristine"
888           aria-label="SAVE"
889           translate="TOOLS.SAVE"
890           translate-attr-aria-label="TOOLS.SAVE"
891         >
892           SAVE
893         </md-button>
894         <md-button
895           type="submit"
896           ng-if="vm.crudPermissions.canEdit && vm.newAction"
897           ng-click="vm.addNewAction()"
898           class="send-button md-accent md-raised"
899           ng-disabled="actionForm.$invalid"
900           aria-label="ADD"
901           translate="TOOLS.ADD_ACTION"
902           translate-attr-aria-label="TOOLS.ADD_ACTION"
903         >
904           ADD ACTION
905         </md-button>
906       </div>
907       <div layout="row">
908         <md-button
909           class="md-icon-button"
910           ng-if="vm.crudPermissions.canDelete && !vm.newAction"
911           ng-click="vm.deleteAction($event)"
912           aria-label="DELETE"
913           translate
914           translate-attr-aria-label="TOOLS.DELETE"
915         >
916           <md-icon md-font-icon="icon-delete"></md-icon>
917           <md-tooltip><span translate="TOOLS.DELETE">DELETE</span></md-tooltip>
918         </md-button>
919       </div>
920     </md-dialog-actions>
921   </form>
922 </md-dialog>